<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>学院列表</title>

<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" href="dist/css/font-awesome-4.4.0/font-awesome.min.css">
<link rel="stylesheet" href="css/AdminLTE.css">
<link rel="stylesheet" href="dist/css/bootstrap.css">
<link rel="stylesheet" href="dist/css/bootstrap-table.css">

</head>
<body style="background-color: rgb(239, 238, 255);">
	<div style="background-color: rgb(44, 102, 148); height: 50px; padding-top: 10px;">
		<a href="main" target="_top"
			style="text-decoration: blink !important; color: #fff; text-align: center !important;">
			<i class="fa fa-book normallogo1"></i>
			<font style="font-family: '微软雅黑'; font-size: 22px;">学生选课系统</font>
		</a>
	</div>
	<div>
		<table id="table">
		</table>	
	</div>

	<script src="dist/js/bootstrap.js"></script>
	<script src="dist/js/jquery-2.2.3.min.js"></script>
	<script src="dist/js/bootstrap.js"></script>
	<script src="dist/js/bootstrap-table.js"></script>
	<script src="dist/js/bootstrap-table-zh-CN.js"></script>
	
	<script type="text/javascript">
		//界面开始加载过程中，直接获取学院数据
		var table;
		$(document).ready(function(){
			$.ajax({
				url:'/ui/get-all-college',
				data:{
				},
				type:'POST',
				dataType:'json',
				success:function(data){					
					var tableLength = data.length;
					table = document.getElementById("table");
					
					for (var i=0;i<tableLength;i++){
					    var tbBody = "";						
						tbBody += "<tr>"
							+"<td><a href='college-course-list?collegeID="+data[i].id+"&collegeName="+data[i].name+"' target='middle'><font color='rgb(44,102,148)'>"+data[i].name+"</font></a></td>"
							+"</tr>";
						$("#table").append(tbBody);													
					}
				},
				error:function() {
					alert("该课程数据加载失败,请点击重试!");
				} 
			});
		});
	</script>
</body>
</html>